#pragma once
#include "RCMacros.h"
#include "RCInterfaces.h"

using namespace RCDX11;
using namespace DirectX;

namespace RCDX11
{
	class RCGraphicsDevice : public IRCGraphicsDevice
	{
	protected:

		D3D_DRIVER_TYPE driverType;
		ID3D11RasterizerState* pRasterState;
		IDXGISwapChain* pSwapChain;
		ID3D11RenderTargetView* pRenderTargetView;
		ID3D11DepthStencilView* pDepthStencilView;
		D3D11_VIEWPORT viewPort;
		D3D_FEATURE_LEVEL  featureLevel;
		ID3D11Texture2D* pDepthStencil;
		ID3D11Device*  pd3dDevice;
		ID3D11DeviceContext* pImmediateContext;

		HWND hWnd;

	

	public:
	
		DECLDIR RCGraphicsDevice(void);
		DECLDIR virtual ~RCGraphicsDevice(void);

		DECLDIR HRESULT Initialize();

		DECLDIR D3D_DRIVER_TYPE getDriverType();
		DECLDIR D3D_FEATURE_LEVEL getFeatureLevel();

		DECLDIR ID3D11RasterizerState* getRasterizer();
		DECLDIR IDXGISwapChain* getSwapChain();
		DECLDIR ID3D11RenderTargetView* getRenderTerget();
		DECLDIR ID3D11DepthStencilView* getDepthStencilView();
		DECLDIR D3D11_VIEWPORT getViewPort();
		DECLDIR ID3D11Texture2D* getDepthStencil();
		DECLDIR ID3D11Device* getDevice();
		DECLDIR ID3D11DeviceContext* getDeviceContext();

		DECLDIR HWND getWindowHandle();

		DECLDIR void Clear(XMFLOAT4 Color, UINT clearFlag,FLOAT depth, UINT8 stencil);
		DECLDIR void Present(UINT sysncInterval, UINT flags);

		DECLDIR HWND InitializeWindow(void** game, LPCTSTR str_Title,int int_XPos, int int_YPos, int int_Width, int int_Height, WNDPROC WinProc, int colorBrush = COLOR_BTNFACE);

	};



}